# -*- coding: utf-8 -*-
# @Time    : 2022/6/16 15:08
# @Author  : TXY
# @Email   : txy@qq.com
# @File    : serializers.py
# @Software: PyCharm
from rest_framework import serializers
#定义返回哪些字段


class StudentSerializers(serializers.Serializer):

    id = serializers.IntegerField(label='ID',read_only=True)#表示只读
    name =serializers.CharField(max_length=30,label='姓名')
    age =serializers.IntegerField(label='年龄',required=False)#表示非必写
    sex = serializers.IntegerField(label='性别',required=False)
    create_time = serializers.DateTimeField(label='创建时间',required=False)
    update_time = serializers.DateTimeField(label='更新时间',required=False)
    is_delete = serializers.BooleanField(label='逻辑删除')













